home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcal / duration.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  1.5 KB  |  60 lines

  1. /*
  2.     This file is part of libkcal.
  3.  
  4.     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.     Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KCAL_DURATION_H
  22. #define KCAL_DURATION_H
  23.  
  24. #include <qdatetime.h>
  25.  
  26. #include "libkcal_export.h"
  27.  
  28. namespace KCal {
  29.  
  30. /**
  31.   This class represents a duration.
  32. */
  33. class LIBKCAL_EXPORT Duration
  34. {
  35.   public:
  36.     Duration();
  37.     Duration( const QDateTime &start, const QDateTime &end );
  38.     Duration( int seconds );
  39.  
  40.     QDateTime end( const QDateTime &start ) const;
  41.  
  42.     int asSeconds() const;
  43.  
  44.   private:
  45.     int mSeconds;
  46.  
  47.     class Private;
  48.     Private *d;
  49. };
  50.  
  51. bool operator==( const Duration&, const Duration& );
  52. inline bool operator!=( const Duration &d1, const Duration &d2 )
  53. {
  54.   return !operator==( d1, d2 );
  55. }
  56.  
  57. }
  58.  
  59. #endif
  60.